import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
// 异步组件
import { defineAsyncComponent } from 'vue'
const Home = () => import('../pages/Home/index.vue')
const result = defineAsyncComponent(() => import('../pages/Home/result.vue'))
const music = defineAsyncComponent(() => import('../pages/Music/index.vue'))
const musicCenter = defineAsyncComponent(() => import('../pages/Music/center.vue'))
const musicPlay = defineAsyncComponent(() => import('../pages/Music/play.vue'))
const musicLogin = defineAsyncComponent(() => import('../pages/Music/login.vue'))
const musicPay = defineAsyncComponent(() => import('../pages/Music/pay.vue'))

const routes: Array<RouteRecordRaw> = [
  {
    path: "/test",
    name: "Home",
    component:  Home,
  },
  {
    path: "/test/result",
    name: "result",
    component: result,
  },
  {
    path: "/",
    name: "music",
    component: music,
  },
  {
    path: "/music/center",
    name: "musicCenter",
    component: musicCenter,
  },
  {
    path: "/music/play",
    name: "musicPlay",
    component: musicPlay,
  },
  {
    path: "/music/login",
    name: "musicLogin",
    component: musicLogin,
  },
  {
    path: "/music/pay",
    name: "musicPay",
    component: musicPay,
  },
]
export default createRouter({
  history: createWebHistory(),
  routes
})